Skip to content

fix(id-web): bound host-view record paging with an advance check - #9051

Merged
dezren39 merged 1 commit into
mainfrom
queue/15336-9043-host-view-paging
Nov 13, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/15336-9043-host-view-paging

Conversation

@developing-today

@developing-today developing-today Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #9043.

Problem

The read-only host view in pkgs/id/web/src/world.ts followed next_after until null with no page bound and no advance check — the one pkgs/id page consumer the #6622 pagination contract's volume rule did not reach (found by the #6623 closing inventory). A repeating cursor from a buggy or compromised host would make the browser re-request the same page forever.

Change

  • pkgs/id/web/src/world-http.ts: new advanceHostViewCursor({ previous, next, page }) guard next to the existing fetch-boundary validation, plus the named bound HOST_VIEW_MAX_PAGES = 256 (each server page is a full budget-bounded records page, so 256 is far beyond any renderable view). A cursor equal to the one just requested throws "records cursor did not advance"; a still-advancing stream at the bound throws "records paging exceeded 256 pages" — both in the page's existing "Host view unavailable …; refresh the host view" vocabulary, rendered by the caller's existing catch.
  • pkgs/id/web/src/world.ts: the host-view loop counts pages and routes next_after through the guard.

Tests

  • world-http.test.ts: new advanceHostViewCursor describe — null-cursor termination and advancing pass-through (controls), repeating-cursor refusal, bound refusal at exactly HOST_VIEW_MAX_PAGES. 23/23 in the file pass.
  • Full web suite: one pre-existing failure in src/search-panel.test.ts (accessibility role assertion), verified failing identically on the clean tree without this change.
  • tsc --noEmit in pkgs/id/web: clean.

Queue task 15336 (lane any-a), follow-on from the #6623 closing inventory.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(id-web): host-view record paging has no page bound or advance check — a repeating next_after loops the browser forever

1 participant